package com.jsrj;

/**
 * 小程序构建状态
 */
public enum BuildStatus {
    QUEUED("构建排队中"), // 构建排队中
    BUILDING("正在构建"), // 正在构建
    SUCCESS("构建成功"), // 构建成功
    FAILURE("构建失败"), // 构建失败
    TIMEOUT("构建超时"), // 构建超时
    VERSION_CREATED("版本创建成功"); // 版本创建成功

    private final String description;

    BuildStatus(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public static String getDescriptionByValue(String value) {
        switch (value) {
            case "0":
                return QUEUED.getDescription();
            case "1":
                return BUILDING.getDescription();
            case "2":
                return SUCCESS.getDescription();
            case "3":
                return FAILURE.getDescription();
            case "5":
                return TIMEOUT.getDescription();
            case "6":
                return VERSION_CREATED.getDescription();
            default:
                return "未知状态";
        }
    }
}


